/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Merlion.MRP.entity;

import Merlion.SCM.entity.ProductEntity;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class PlannedDemandEntity implements Serializable {

    @Id
    protected String id;
    protected Integer yearInt;
    protected Integer monthInt;
    protected Integer weekOfMonth;
    protected Integer dayOfMonth;
    @ManyToOne
    protected ProductEntity product;
    //protected int aggregateDemand;
    //@OneToMany(mappedBy = "plannedDemand")
    //private Collection<PlannedDemandAmendmentEntity> plannedDemandAmendmentEntities;

    public PlannedDemandEntity() {
    }

    /*
    public int getAggregateDemand() {
    return aggregateDemand;
    }
    
    public void setAggregateDemand(int aggregateDemand) {
    this.aggregateDemand = aggregateDemand;
    }
     * 
     */
    public Integer getDayOfMonth() {
        return dayOfMonth;
    }

    public void setDayOfMonth(Integer dayOfMonth) {
        this.dayOfMonth = dayOfMonth;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getMonthInt() {
        return monthInt;
    }

    public void setMonthInt(Integer monthInt) {
        this.monthInt = monthInt;
    }

    public ProductEntity getProduct() {
        return product;
    }

    public void setProduct(ProductEntity product) {
        this.product = product;
    }

    public Integer getWeekOfMonth() {
        return weekOfMonth;
    }

    public void setWeekOfMonth(Integer weekOfMonth) {
        this.weekOfMonth = weekOfMonth;
    }

    public Integer getYearInt() {
        return yearInt;
    }

    public void setYearInt(Integer yearInt) {
        this.yearInt = yearInt;
    }
/*
    public Collection<PlannedDemandAmendmentEntity> getPlannedDemandAmendmentEntities() {
        return plannedDemandAmendmentEntities;
    }

    public void setPlannedDemandAmendmentEntities(Collection<PlannedDemandAmendmentEntity> plannedDemandAmendmentEntities) {
        this.plannedDemandAmendmentEntities = plannedDemandAmendmentEntities;
    }
*
     * 
     */
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PlannedDemandEntity)) {
            return false;
        }
        PlannedDemandEntity other = (PlannedDemandEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mrp.entities.PlannedDemand[ id=" + id + " ]";
    }
}
